"""
 -*- coding: utf-8-*-
 @File: index.py
 @Author: chen
 @time: 2023/07/22/ 9:13
"""
from hogwartsHomework.homework_python.management.student_management import StudentManagement


def welcome():
    print("欢迎来到学员信息管理系统".center(36, "*"))
    print("\t1、根据学号查看学员信息")
    print("\t2、添加学员")
    print("\t3、根据学号删除学员后，查看所有学员信息")
    print("\t4、查询当前所有学员信息")
    print("\t5、退出系统")
    print()


def start():
    mgt = StudentManagement()
    welcome()
    mgt.main()

    while True:
        print("=" * 36)
        choice = input("请输入你的选择：")
        if choice == "1":
            print("查询学生")
            mgt.find()

        elif choice == "2":
            print("添加学生")
            mgt.add()

        elif choice == "3":
            print("删除学生")
            mgt.delete()

        elif choice == "4":
            print("所有学生")
            mgt.all()

        elif choice == "5":
            print("成功退出系统，欢迎下次使用")
            break
        else:
            print("您输入的有误，请重新输入")
            # raise ChooseError


if __name__ == '__main__':
    start()
